﻿using CommunityToolkit.Mvvm.ComponentModel;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.IO;

using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Media;
using 充电桩上位机.Model.User;

namespace 充电桩上位机.ViewModel.UserRegisters;

public class UserRegistersViewModel : ObservableObject
{
    private string _stackText = string.Empty;
    public string StackText
    {
        get => _stackText;
        set => SetProperty(ref _stackText, value);
    }
    private string _time_allocation_Text = string.Empty;
    public string Time_allocation_Text
    {
        get => _time_allocation_Text;
        set => SetProperty(ref _time_allocation_Text, value);
    }
    #region 几个网站
    private bool _steve_1 = false;
    public bool Steve_1
    {
        get => _steve_1;
        set
        {
            if (value)
            {
                OtherIsCheck = false;
                OCPPCheckData = "ws://47.97.181.104:8080/steve/websocket/CentralSystemService/(chargeBoxId)";
            }
            SetProperty(ref _steve_1, value);
        }
    }
    private bool _steve_2 = false;
    public bool Steve_2
    {
        get => _steve_2;
        set
        {
            if (value)
            {
                OtherIsCheck = false;
                OCPPCheckData = "ws://47.101.173.122:8080/steve/websocket/CentralSystemService/(chargeBoxId)";
            }
            SetProperty(ref _steve_2, value);
        }
    }
    private bool _monts = false;
    public bool Monts
    {
        get => _monts;
        set
        {
            if (value)
            {
                OtherIsCheck = false;
                OCPPCheckData = "ws://monitor.evocpp.com/evid";
            }
            SetProperty(ref _monts, value);
        }
    }
    private bool _eVSaas = false;
    public bool EVSaas
    {
        get => _eVSaas;
        set
        {
            if (value)
            {
                OtherIsCheck = false;
                OCPPCheckData = "wss://www.evocpp.com/ocpp/evid";
            }
            SetProperty(ref _eVSaas, value);
        }
    }
    private bool _z_BOX = false;
    public bool Z_BOX
    {
        get => _z_BOX;
        set
        {
            if (value)
            {
                OtherIsCheck = false;
                OCPPCheckData = "wss://zbox.evocpp.com/ocpp/evid";
            }
            SetProperty(ref _z_BOX, value);
        }
    }
    private bool _otherIsCheck = false;
    public bool OtherIsCheck
    {
        get => _otherIsCheck;
        set { 
            if (value)
            {
                var st = OCPPCheckData;
                Steve_1 = false;
                Steve_2 = false;
                Monts = false;
                EVSaas = false;
                Z_BOX = false;
                OCPPCheckData = st;
            }
            SetProperty(ref _otherIsCheck, value); 
        }
    }
    
    #endregion
    private Brush _passwordColor = Brushes.Black;
    public Brush PasswordColor
    {
        get => _passwordColor;
        set => SetProperty(ref _passwordColor, value);
    }

    private Visibility _passwordState = Visibility.Hidden;
    public Visibility PasswordState
    {
        get => _passwordState;
        set => SetProperty(ref _passwordState, value);
    }

    [Category("用户密码")]
    private string _userPassword = string.Empty;
    public string UserPassword
    {
        get => _userPassword;
        set {
            string pattern = @"[^\x00-\x7F]";
            Regex regex = new Regex(pattern);
            if (!regex.IsMatch(value))
            {
                if ((value.Length < 8 || value.Length > 10) && value != "")
                {
                    PasswordColor = Brushes.Red;
                    PasswordState = Visibility.Visible;
                }
                else
                {
                    PasswordColor = Brushes.Black;
                    PasswordState = Visibility.Hidden;
                }
                SetProperty(ref _userPassword, value);
            }
        }
    }
    [Category("Modbus地址")]
    private string _modbusAddress = string.Empty;
    public string ModbusAddress
    {
        get => _modbusAddress;
        set {
            string pattern = @"^\d+$";
            Regex regex = new Regex(pattern);
            if ((regex.IsMatch(value) && value.Length < 4) || value == "")
            {
                SetProperty(ref _modbusAddress, value);
            }
        }
    }
    [Category("RS485波特率")]
    private int _rS485Baud = 0;
    public int RS485Baud
    {
        get => _rS485Baud;
        set => SetProperty(ref _rS485Baud, value);
    }
    private ObservableCollection<string> _baudRateModes = new() { "9600", "115200"};
    public ObservableCollection<string> BaudRateModes
    {
        get => _baudRateModes;
        set => SetProperty(ref _baudRateModes, value);
    }
    [Category("MAC充电是否启用")]
    private bool _macCharging = false;
    public bool MacCharging
    {
        get => _macCharging;
        set => SetProperty(ref _macCharging, value);
    }
    [Category("POS充电是否启用")]
    private bool _posCharing = false;
    public bool PosCharing
    {
        get => _posCharing;
        set => SetProperty(ref _posCharing, value);
    }
    [Category("DC枪兼容充电模式是否启用")]
    private bool _dC_Complatible_Charging = false;
    public bool DC_Complatible_Charging
    {
        get => _dC_Complatible_Charging;
        set => SetProperty(ref _dC_Complatible_Charging, value);
    }
    [Category("DC枪兼容充电模式是否启用")]
    private bool _aC_Complatible_Charging = false;
    public bool AC_Complatible_Charging
    {
        get => _aC_Complatible_Charging;
        set => SetProperty(ref _aC_Complatible_Charging, value);
    }
    [Category("POS预扣款金额")]
    private string _posWithholdingAmount = string.Empty;
    public string PosWithholdingAmount
    {
        get => _posWithholdingAmount;
        set {
            double amount = 0;
            if (double.TryParse(value, out amount))
            {
                if (!string.IsNullOrEmpty(Currency_Unit_Precision))
                    SetProperty(ref _posWithholdingAmount, amount.ToString("f" + Currency_Unit_Precision));
            }
            else if (value == "") SetProperty(ref _posWithholdingAmount, value);
        }
    }
    [Category("POS金额单位")]
    private string _posAmountUnit = string.Empty;
    public string PosAmountUnit
    {
        get => _posAmountUnit;
        set { 
            switch (value)
            {
                case "EUR":
                    MoneyUnit = "€";
                    break;
                case "CZK":
                    MoneyUnit = "Kč";
                    break;
                case "TRY":
                    MoneyUnit = "₺";
                    break;
                case "THB":
                    MoneyUnit = "฿";
                    break;
                case "CNY":
                    MoneyUnit = "￥";
                    break;
            }
            SetProperty(ref _posAmountUnit, value); 
        }
    }
    private ObservableCollection<string> _posAmountUnits = new() { "EUR", "CZK", "TRY", "THB", "CNY" };
    public ObservableCollection<string> PosAmountUnits
    {
        get => _posAmountUnits;
        set => SetProperty(ref _posAmountUnits, value);
    }
    private string _moneyUnit = string.Empty;
    public string MoneyUnit
    {
        get => _moneyUnit;
        set {
            MoneyUnitkWh = value + "/kWh";
            MoneyUnitService = value + "/h";
            SetProperty(ref _moneyUnit, value); 
        }
    }
    private string _moneyUnitkWh = string.Empty;
    public string MoneyUnitkWh
    {
        get => _moneyUnitkWh;
        set => SetProperty(ref _moneyUnitkWh, value);
    }
    private string _moneyUnitService = string.Empty;
    public string MoneyUnitService
    {
        get => _moneyUnitService;
        set => SetProperty(ref _moneyUnitService, value);
    }
    [Category("单位电价每kwh的价格")]
    private string _elecPrice = string.Empty;
    public string ElecPrice
    {
        get => _elecPrice;
        set {
            double amount = 0;
            if (double.TryParse(value, out amount))
            {
                if (!string.IsNullOrEmpty(Currency_Unit_Precision))
                    SetProperty(ref _elecPrice, amount.ToString("f" + Currency_Unit_Precision));
            }
            else if (value == "") SetProperty(ref _elecPrice, value);
        }
    }
    [Category("单位小时服务费")]
    private string _serviceCharge = string.Empty;
    public string ServiceCharge
    {
        get => _serviceCharge;
        set {
            double amount = 0;
            if (double.TryParse(value, out amount))
            {
                if (!string.IsNullOrEmpty(Currency_Unit_Precision))
                    SetProperty(ref _serviceCharge, amount.ToString("f" + Currency_Unit_Precision));
            }
            else if (value == "") SetProperty(ref _serviceCharge, value);
        }
    }
    [Category("遥测数据设置")]
    private bool _enable_the_Second_Platform = false;
    public bool Enable_the_Second_Platform
    {
        get => _enable_the_Second_Platform;
        set => SetProperty(ref _enable_the_Second_Platform, value);
    }
    [Category("LCD第一语言")]
    private int _lDCLangurageFirst = new();
    public int LDCLangurageFirst
    {
        get => _lDCLangurageFirst;
        set {
            //该语言隐藏掉
            SetProperty(ref _lDCLangurageFirst, value);
        }
    }
    [Category("LCD第二语言")]
    private int _lDCLangurageSecond = new();
    public int LDCLangurageSecond
    {
        get => _lDCLangurageSecond;
        set {
            SetProperty(ref _lDCLangurageSecond, value);
        }
    }
    //语言条目
    private ObservableCollection<Language> _languages = new();
    public ObservableCollection<Language> Languages
    {
        get => _languages;
        set => SetProperty(ref _languages, value);
    }

    [Category("是否启用自动使用Mac充电")]
    private bool _automaticChargingforMac = false;
    public bool AutomaticChargingforMac
    {
        get => _automaticChargingforMac;
        set => SetProperty(ref _automaticChargingforMac, value);
    }
    [Category("屏幕右下角的文字")]
    private string _showScreen = string.Empty;
    public string ShowScreen
    {
        get => _showScreen;
        set {
            if (value != null && value.Length <= 10)
                SetProperty(ref _showScreen, value); 
        }
    }
    private ObservableCollection<string> _macReportFormatItem = new();
    public ObservableCollection<string> MacReportFormatItem
    {
        get => _macReportFormatItem;
        set => SetProperty(ref _baudRateModes, value);
    }
    [Category("MAC上报格式")]
    private int _macReportFormat = 0;
    public int MacReportFormat
    {
        get => _macReportFormat;
        set => SetProperty(ref _macReportFormat, value);
    }
    [Category("RFID禁用")]
    private bool _disabled_RFID = false;
    public bool Disabled_RFID
    {
        get => _disabled_RFID;
        set => SetProperty(ref _disabled_RFID, value);
    }
    [Category("是否锁定使用UTC时间")]
    private bool _lockToUseUtcTime = false;
    public bool LockToUseUtcTime
    {
        get => _lockToUseUtcTime;
        set => SetProperty(ref _lockToUseUtcTime, value);
    }
    [Category("直接按键停止充电使能")]
    private bool _pressButtonToStopCharging = false;
    public bool PressButtonToStopCharging
    {
        get => _pressButtonToStopCharging;
        set => SetProperty(ref _pressButtonToStopCharging, value);
    }

    [Category("OCPP遥测服务器触发，E07寄存器触发保存")]
    private bool _oCPPTelemetryCheck = false;
    public bool OCPPTelemetryCheck
    {
        get => _oCPPTelemetryCheck;
        set {
            if (value)
                MessageBox.Show("Upon pressing, the OCPP-related information will be saved");
            SetProperty(ref _oCPPTelemetryCheck, value); 
        }
    }
    [Category("OCPP遥测服务器地址")]
    private string _oCPPCheckData = string.Empty;
    public string OCPPCheckData
    {
        get => _oCPPCheckData;
        set {
            var favor = value.Split('/').LastOrDefault()!;

            if (favor != null)
            {
                StackText = favor;
            }
            SetProperty(ref _oCPPCheckData, value); 
        }
    }

    [Category("OCPP遥测服务器 HTTP身份验证使能")]
    private bool _oCPPUserInit = false;
    public bool OCPPUserInit
    {
        get => _oCPPUserInit;
        set => SetProperty(ref _oCPPUserInit, value);
    }
    [Category("OCPP遥测服务器 HTTP身份校验用户名")]
    private string _oCPPuserName = string.Empty;
    public string OCPPUserName
    {
        get => _oCPPuserName;
        set {
            //特殊字符不可输入
            if (Regex.IsMatch(value, @"^[a-zA-Z0-9]*$"))
                SetProperty(ref _oCPPuserName, value); 
        }
    }
    [Category("OCPP遥测服务器 HTTP身份校验密码")]
    private string _oCPPUserPassword = string.Empty;
    public string OCPPUserPassword
    {
        get => _oCPPUserPassword;
        set {
            if (Regex.IsMatch(value, @"^[a-zA-Z0-9]*$"))
                SetProperty(ref _oCPPUserPassword, value); 
        }
    }
    [Category("是否禁止未插枪远程鉴权")]
    private bool _forbidAuthorizeInUnplug = false;
    public bool ForbidAuthorizeInUnplug
    {
        get => _forbidAuthorizeInUnplug;
        set => SetProperty(ref _forbidAuthorizeInUnplug, value);
    }
    [Category("离线IC 卡允许在OCPP模式下进行本地缓存检验")]
    private bool _offline_IC_CardLocal_Authorization = false;
    public bool Offline_IC_CardLocal_Authorization
    {
        get => _offline_IC_CardLocal_Authorization;
        set => SetProperty(ref _offline_IC_CardLocal_Authorization, value);
    }
    [Category("PE检测是否禁用")]
    private bool _disablePE = false;
    public bool DisablePE
    {
        get => _disablePE;
        set => SetProperty(ref _disablePE, value);
    }
    [Category("校准时间")]
    private string _equipTime = string.Empty;
    public string EquipTime
    {
        get => _equipTime;
        set => SetProperty(ref _equipTime, value);
    }
    [Category("离线IC卡号1")]
    private string _offline_Card_1 = string.Empty;
    public string Offline_Card_1
    {
        get => _offline_Card_1;
        set => SetProperty(ref _offline_Card_1, value);
    }
    [Category("离线IC卡号2")]
    private string _offline_Card_2 = string.Empty;
    public string Offline_Card_2
    {
        get => _offline_Card_2;
        set => SetProperty(ref _offline_Card_2, value);
    }
    [Category("离线IC卡号3")]
    private string _offline_Card_3 = string.Empty;
    public string Offline_Card_3
    {
        get => _offline_Card_3;
        set => SetProperty(ref _offline_Card_3, value);
    }
    [Category("离线IC卡号4")]
    private string _offline_Card_4 = string.Empty;
    public string Offline_Card_4
    {
        get => _offline_Card_4;
        set => SetProperty(ref _offline_Card_4, value);
    }
    [Category("离线IC卡号5")]
    private string _offline_Card_5 = string.Empty;
    public string Offline_Card_5
    {
        get => _offline_Card_5;
        set => SetProperty(ref _offline_Card_5, value);
    }
    [Category("禁用服务器时间来校准充电桩")]
    private bool _calibrating_EVSE_Using_ServerTime = false;
    public bool Calibrating_EVSE_Using_ServerTime
    {
        get => _calibrating_EVSE_Using_ServerTime;
        set => SetProperty(ref _calibrating_EVSE_Using_ServerTime, value);
    }
    [Category("Bootnotification 在每次重新连接服务器后都会重新发送一次")]
    private bool _retransmit_Notifications_on_Reconnect = false;
    public bool Retransmit_Notifications_on_Reconnect
    {
        get => _retransmit_Notifications_on_Reconnect;
        set => SetProperty(ref _retransmit_Notifications_on_Reconnect, value);
    }
    [Category("Heart 总是根据配置项定时发送， 不受websocket的ping pong 影响")]
    private bool _scheduled_Heartbeat_Sending = false;
    public bool Scheduled_Heartbeat_Sending
    {
        get => _scheduled_Heartbeat_Sending;
        set => SetProperty(ref _scheduled_Heartbeat_Sending, value);
    }
    [Category("Modbus临时功率限制")]
    private int _modbusLimit = -1;
    public int ModbusLimit
    {
        get => _modbusLimit;
        set => SetProperty(ref _modbusLimit, value);
    }
    [Category("是否启用离线充电模式下的即插即充")]
    private bool _enable_plug = false;
    public bool Enable_plug
    {
        get => _enable_plug;
        set => SetProperty(ref _enable_plug, value);
    }
    [Category("是否启用OCPP延迟连接")]
    private bool _delayed_Connection = false;
    public bool Delayed_Connection
    {
        get => _delayed_Connection;
        set => SetProperty(ref _delayed_Connection, value);
    }
    [Category("POS机启动的数据，不经过OCPP平台，当POS机启动充电的时候，枪头变为unvaliable")]
    private bool _no_Pass_OCPP = false;
    public bool No_Pass_OCPP
    {
        get => _no_Pass_OCPP;
        set => SetProperty(ref _no_Pass_OCPP, value);
    }
    [Category("地锁支持")]
    private bool _ground_Lock_Support = false;
    public bool Ground_Lock_Support
    {
        get => _ground_Lock_Support;
        set => SetProperty(ref _ground_Lock_Support, value);
    }
    [Category("自动使用MAC充电倒计时秒数")]
    private string _automatic_MAC_Charging_Countdown_in_Seconds = string.Empty;
    public string Automatic_MAC_Charging_Countdown_in_Seconds
    {
        get => _automatic_MAC_Charging_Countdown_in_Seconds;
        set {
            string pattern = @"^\d+$";
            Regex regex = new Regex(pattern);
            if (regex.IsMatch(value) || value == "")
            {
                SetProperty(ref _automatic_MAC_Charging_Countdown_in_Seconds, value);
            }
        }
    }
    [Category("服务费单位")]
    private int _serviceFeeUnit = 0;
    public int ServiceFeeUnit
    {
        get => _serviceFeeUnit;
        set => SetProperty(ref _serviceFeeUnit, value);
    }

    private ObservableCollection<string> _currency_UnitList = new();
    public ObservableCollection<string> Currency_UnitList
    {
        get => _currency_UnitList;
        set => SetProperty(ref _currency_UnitList, value);
    }
    [Category("货币单位精度")]
    private string _currency_Unit_Precision = string.Empty;
    public string Currency_Unit_Precision
    {
        get => _currency_Unit_Precision;
        set => SetProperty(ref _currency_Unit_Precision, value);
    }
    [Category("LCD视频广告播放策略")]
    private ObservableCollection<string> _lCDOpenLogicalList = new();
    public ObservableCollection<string> LCDOpenLogicalList
    {
        get => _lCDOpenLogicalList;
        set => SetProperty(ref _lCDOpenLogicalList, value);
    }
    private int _selLCDOpenLogical = -1;
    public int SelLCDOpenLogical
    {
        get => _selLCDOpenLogical;
        set => SetProperty(ref _selLCDOpenLogical, value);
    }
    [Category("LCD视频广告存放位置")]
    private ObservableCollection<string> _lCDOpenAddrList = new();
    public ObservableCollection<string> LCDOpenAddrList
    {
        get => _lCDOpenAddrList;
        set => SetProperty(ref _lCDOpenAddrList, value);
    }
    private int _selLCDOpenAddr = -1;
    public int SelLCDOpenAddr
    {
        get => _selLCDOpenAddr;
        set => SetProperty(ref _selLCDOpenAddr, value);
    }
    [Category("LCD视频广告存放数量")]
    private string _selLCDOpenAccount = string.Empty;
    public string SelLCDOpenAccount
    {
        get => _selLCDOpenAccount;
        set {
            string pattern = @"^\d+$";
            Regex regex = new Regex(pattern);
            if (regex.IsMatch(value) || value == "")
            {
                SetProperty(ref _selLCDOpenAccount, value);
            }
        }
    }
    [Category("充电桩启动充电过程异常，是上报suspend 还是上报 fault")]
    private ObservableCollection<string> _errorStartElecMsgList = new();
    public ObservableCollection<string> ErrorStartElecMsgList
    {
        get => _errorStartElecMsgList;
        set => SetProperty(ref _errorStartElecMsgList, value);
    }
    private int _selErrorStartElecMsg = -1;
    public int SelErrorStartElecMsg
    {
        get => _selErrorStartElecMsg;
        set => SetProperty(ref _selErrorStartElecMsg, value);
    }
    [Category("是否允许充电桩未插枪本地刷卡 （无按钮，插枪界面允许直接刷卡鉴权）")]
    private bool _no_Pass_Clash = false;
    public bool No_Pass_Clash
    {
        get => _no_Pass_Clash;
        set => SetProperty(ref _no_Pass_Clash, value);
    }
    [Category("Offline MeterValue 禁用")]
    private bool _offlineMaterValue = false;
    public bool OfflineMaterValue
    {
        get => _offlineMaterValue;
        set => SetProperty(ref _offlineMaterValue, value);
    }
    [Category(" 每次断网重连后, StatusNotification 发送逻辑设定")]
    private ObservableCollection<string> _restartLineList = new();
    public ObservableCollection<string> RestartLineList
    {
        get => _restartLineList;
        set => SetProperty(ref _restartLineList, value);
    }
    private int _selRestartLine = -1;
    public int SelRestartLine
    {
        get => _selRestartLine;
        set => SetProperty(ref _selRestartLine, value);
    }
    private ObservableCollection<string> _charging_Start_FailureList = new();
    public ObservableCollection<string> Charging_Start_FailureList
    {
        get => _charging_Start_FailureList;
        set => SetProperty(ref _charging_Start_FailureList, value);
    }
    private int _selCharging_Start_Failure = -1;
    public int SelCharging_Start_Failure
    {
        get => _selCharging_Start_Failure;
        set => SetProperty(ref _selCharging_Start_Failure, value);
    }
    #region 全球化

    private string _user_Registers_Text = string.Empty;
    public string User_Registers_Text
    {
        get => _user_Registers_Text;
        set => SetProperty(ref _user_Registers_Text, value);
    }
    private string _password_Text = string.Empty;
    public string Password_Text
    {
        get => _password_Text;
        set => SetProperty(ref _password_Text, value);
    }
    private string _user_Password_ToolTip = string.Empty;
    public string User_Password_ToolTip
    {
        get => _user_Password_ToolTip;
        set => SetProperty(ref _user_Password_ToolTip, value);
    }
    private string _modbus_Address_Text = string.Empty;
    public string Modbus_Address_Text
    {
        get => _modbus_Address_Text;
        set => SetProperty(ref _modbus_Address_Text, value);
    }
    private string _modbus_HelpText = string.Empty;
    public string Modbus_HelpText
    {
        get => _modbus_HelpText;
        set => SetProperty(ref _modbus_HelpText, value);
    }
    private string _pOS_Amount_Unit_Text = string.Empty;
    public string POS_Amount_Unit_Text
    {
        get => _pOS_Amount_Unit_Text;
        set => SetProperty(ref _pOS_Amount_Unit_Text, value);
    }
    private string _pOS_Withholding_Amount_Text = string.Empty;
    public string POS_Withholding_Amount_Text
    {
        get => _pOS_Withholding_Amount_Text;
        set => SetProperty(ref _pOS_Withholding_Amount_Text, value);
    }
    private string _electricity_Price_Text = string.Empty;
    public string Electricity_Price_Text
    {
        get => _electricity_Price_Text;
        set => SetProperty(ref _electricity_Price_Text, value);
    }
    private string _service_Charge_Text = string.Empty;
    public string Service_Charge_Text
    {
        get => _service_Charge_Text;
        set => SetProperty(ref _service_Charge_Text, value);
    }
    private string _screen_Text = string.Empty;
    public string Screen_Text
    {
        get => _screen_Text;
        set => SetProperty(ref _screen_Text, value);
    }
    private string _rS485_BaudRate_Text = string.Empty;
    public string RS485_BaudRate_Text
    {
        get => _rS485_BaudRate_Text;
        set => SetProperty(ref _rS485_BaudRate_Text, value);
    }
    private string _mAC_Reporting_Format_Text = string.Empty;
    public string MAC_Reporting_Format_Text
    {
        get => _mAC_Reporting_Format_Text;
        set => SetProperty(ref _mAC_Reporting_Format_Text, value);
    }
    private string _automatic_Text = string.Empty;
    public string Automatic_Text
    {
        get => _automatic_Text;
        set => SetProperty(ref _automatic_Text, value);
    }
    private string _whether_Modbus_Text = string.Empty;
    public string Whether_Modbus_Text
    {
        get => _whether_Modbus_Text;
        set => SetProperty(ref _whether_Modbus_Text, value);
    }
    private string _service_Fee_Unit_Text = string.Empty;
    public string Service_Fee_Unit_Text
    {
        get => _service_Fee_Unit_Text;
        set => SetProperty(ref _service_Fee_Unit_Text, value);
    }
    private string _currency_Unit_Text = string.Empty;
    public string Currency_Unit_Text
    {
        get => _currency_Unit_Text;
        set => SetProperty(ref _currency_Unit_Text, value);
    }
    private string _lCD_Media_Open_Config_Text = string.Empty;
    public string LCD_Media_Open_Config_Text
    {
        get => _lCD_Media_Open_Config_Text;
        set => SetProperty(ref _lCD_Media_Open_Config_Text, value);
    }
    private string _lCD_Media_Open_Addr_Text = string.Empty;
    public string LCD_Media_Open_Addr_Text
    {
        get => _lCD_Media_Open_Addr_Text;
        set => SetProperty(ref _lCD_Media_Open_Addr_Text, value);
    }
    private string _lCD_Media_Amount_Text = string.Empty;
    public string LCD_Media_Amount_Text
    {
        get => _lCD_Media_Amount_Text;
        set => SetProperty(ref _lCD_Media_Amount_Text, value);
    }
    private string _suspendOrFault_Text = string.Empty;
    public string SuspendOrFault_Text
    {
        get => _suspendOrFault_Text;
        set => SetProperty(ref _suspendOrFault_Text, value);
    }
    private string _offine_Trans_logical_Text = string.Empty;
    public string Offine_Trans_logical_Text
    {
        get => _offine_Trans_logical_Text;
        set => SetProperty(ref _offine_Trans_logical_Text, value);
    }
    private string _offline_IC_1_Text = string.Empty;
    public string Offline_IC_1_Text
    {
        get => _offline_IC_1_Text;
        set => SetProperty(ref _offline_IC_1_Text, value);
    }
    private string _offline_IC_2_Text = string.Empty;
    public string Offline_IC_2_Text
    {
        get => _offline_IC_2_Text;
        set => SetProperty(ref _offline_IC_2_Text, value);
    }
    private string _offline_IC_3_Text = string.Empty;
    public string Offline_IC_3_Text
    {
        get => _offline_IC_3_Text;
        set => SetProperty(ref _offline_IC_3_Text, value);
    }
    private string _offline_IC_4_Text = string.Empty;
    public string Offline_IC_4_Text
    {
        get => _offline_IC_4_Text;
        set => SetProperty(ref _offline_IC_4_Text, value);
    }
    private string _offline_IC_5_Text = string.Empty;
    public string Offline_IC_5_Text
    {
        get => _offline_IC_5_Text;
        set => SetProperty(ref _offline_IC_5_Text, value);
    }
    private string _language_Setting_Text = string.Empty;
    public string Language_Setting_Text
    {
        get => _language_Setting_Text;
        set => SetProperty(ref _language_Setting_Text, value);
    }
    private string _oCPP_Title_Text = string.Empty;
    public string OCPP_Title_Text
    {
        get => _oCPP_Title_Text;
        set => SetProperty(ref _oCPP_Title_Text, value);
    }
    private string _oCPP_UserName_Text = string.Empty;
    public string OCPP_UserName_Text
    {
        get => _oCPP_UserName_Text;
        set => SetProperty(ref _oCPP_UserName_Text, value);
    }
    private string _oCPP_Password_Text = string.Empty;
    public string OCPP_Password_Text
    {
        get => _oCPP_Password_Text;
        set => SetProperty(ref _oCPP_Password_Text, value);
    }
    private string _macCharging_Text = string.Empty;
    public string MacCharging_Text
    {
        get => _macCharging_Text;
        set => SetProperty(ref _macCharging_Text, value);
    }
    private string _pOS_Charing_Text = string.Empty;
    public string POS_Charing_Text
    {
        get => _pOS_Charing_Text;
        set => SetProperty(ref _pOS_Charing_Text, value);
    }
    private string _dC_Complatible_Charging_Text = string.Empty;
    public string DC_Complatible_Charging_Text
    {
        get => _dC_Complatible_Charging_Text;
        set => SetProperty(ref _dC_Complatible_Charging_Text, value);
    }
    private string _aC_Complatible_Charging_Text = string.Empty;
    public string AC_Complatible_Charging_Text
    {
        get => _aC_Complatible_Charging_Text;
        set => SetProperty(ref _aC_Complatible_Charging_Text, value);
    }
    private string _disabled_RFID_Text = string.Empty;
    public string Disabled_RFID_Text
    {
        get => _disabled_RFID_Text;
        set => SetProperty(ref _disabled_RFID_Text, value);
    }
    private string _lockToUseUtcTime_Text = string.Empty;
    public string LockToUseUtcTime_Text
    {
        get => _lockToUseUtcTime_Text;
        set => SetProperty(ref _lockToUseUtcTime_Text, value);
    }
    private string _pressButtonToStopCharging_Text = string.Empty;
    public string PressButtonToStopCharging_Text
    {
        get => _pressButtonToStopCharging_Text;
        set => SetProperty(ref _pressButtonToStopCharging_Text, value);
    }
    private string _forbidAuthorizeInUnplug_Text = string.Empty;
    public string ForbidAuthorizeInUnplug_Text
    {
        get => _forbidAuthorizeInUnplug_Text;
        set => SetProperty(ref _forbidAuthorizeInUnplug_Text, value);
    }
    private string _offline_IC_CardLocal_Authorization_Text = string.Empty;
    public string Offline_IC_CardLocal_Authorization_Text
    {
        get => _offline_IC_CardLocal_Authorization_Text;
        set => SetProperty(ref _offline_IC_CardLocal_Authorization_Text, value);
    }
    private string _disablePE_Text = string.Empty;
    public string DisablePE_Text
    {
        get => _disablePE_Text;
        set => SetProperty(ref _disablePE_Text, value);
    }
    private string _calibrating_EVSE_Using_ServerTime_Text = string.Empty;
    public string Calibrating_EVSE_Using_ServerTime_Text
    {
        get => _calibrating_EVSE_Using_ServerTime_Text;
        set => SetProperty(ref _calibrating_EVSE_Using_ServerTime_Text, value);
    }
    private string _retransmit_Notifications_on_Reconnect_Text = string.Empty;
    public string Retransmit_Notifications_on_Reconnect_Text
    {
        get => _retransmit_Notifications_on_Reconnect_Text;
        set => SetProperty(ref _retransmit_Notifications_on_Reconnect_Text, value);
    }
    private string _scheduled_Heartbeat_Sending_Text = string.Empty;
    public string Scheduled_Heartbeat_Sending_Text
    {
        get => _scheduled_Heartbeat_Sending_Text;
        set => SetProperty(ref _scheduled_Heartbeat_Sending_Text, value);
    }
    private string _enable_the_Second_Platform_Text = string.Empty;
    public string Enable_the_Second_Platform_Text
    {
        get => _enable_the_Second_Platform_Text;
        set => SetProperty(ref _enable_the_Second_Platform_Text, value);
    }
    private string _automaticChargingforMac_Text = string.Empty;
    public string AutomaticChargingforMac_Text
    {
        get => _automaticChargingforMac_Text;
        set => SetProperty(ref _automaticChargingforMac_Text, value);
    }
    private string _enable_plug_Text = string.Empty;
    public string Enable_plug_Text
    {
        get => _enable_plug_Text;
        set => SetProperty(ref _enable_plug_Text, value);
    }
    private string _delayed_Connection_Text = string.Empty;
    public string Delayed_Connection_Text
    {
        get => _delayed_Connection_Text;
        set => SetProperty(ref _delayed_Connection_Text, value);
    }
    private string _no_Pass_OCPP_Text = string.Empty;
    public string No_Pass_OCPP_Text
    {
        get => _no_Pass_OCPP_Text;
        set => SetProperty(ref _no_Pass_OCPP_Text, value);
    }
    private string _ground_Lock_Support_Text = string.Empty;
    public string Ground_Lock_Support_Text
    {
        get => _ground_Lock_Support_Text;
        set => SetProperty(ref _ground_Lock_Support_Text, value);
    }
    private string _no_Pass_Clash_Text = string.Empty;
    public string No_Pass_Clash_Text
    {
        get => _no_Pass_Clash_Text;
        set => SetProperty(ref _no_Pass_Clash_Text, value);
    }
    private string _offlineMaterValue_Text = string.Empty;
    public string OfflineMaterValue_Text
    {
        get => _offlineMaterValue_Text;
        set => SetProperty(ref _offlineMaterValue_Text, value);
    }
    private string _stack_Text = string.Empty;
    public string Stack_Text
    {
        get => _stack_Text;
        set => SetProperty(ref _stack_Text, value);
    }
    private string _other_Text = string.Empty;
    public string Other_Text
    {
        get => _other_Text;
        set => SetProperty(ref _other_Text, value);
    }
    private string _oCPP_Server_Init = string.Empty;
    public string OCPP_Server_Init
    {
        get => _oCPP_Server_Init;
        set => SetProperty(ref _oCPP_Server_Init, value);
    }
    private string _charging_Start_Failure_Text = string.Empty;
    public string Charging_Start_Failure_Text
    {
        get => _charging_Start_Failure_Text;
        set => SetProperty(ref _charging_Start_Failure_Text, value);
    }   
    #endregion
    public UserRegistersViewModel()
    {
        //加载语言和图标    
        string _appStartupPath = Path.GetDirectoryName(Environment.ProcessPath)!;
        string savepath = new(Path.Combine
                (_appStartupPath!, "Assets", "Country"));
        #region 全球化
        MacReportFormatItem.Clear();
        MacReportFormatItem.Add(MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "NormalModel"));
        MacReportFormatItem.Add(MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "PEAModel"));
        LCDOpenLogicalList.Clear();
        LCDOpenLogicalList.Add(MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "No Use"));
        LCDOpenLogicalList.Add(MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Loop Playback After Trigger"));
        LCDOpenAddrList.Clear();
        LCDOpenAddrList.Add(MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "SD Card"));
        LCDOpenAddrList.Add(MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "USB drive"));
        ErrorStartElecMsgList.Clear();
        ErrorStartElecMsgList.Add(MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Report suspend"));
        ErrorStartElecMsgList.Add(MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Report fault"));
        RestartLineList.Clear();
        RestartLineList.Add(MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Trigger upon every restart"));
        RestartLineList.Add(MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "After each restart, resend only if the status has changed."));
        Charging_Start_FailureList.Clear();
        Charging_Start_FailureList.Add(MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, 
            "0: Automatically reverts to Available or Preparing status"));
        Charging_Start_FailureList.Add(MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage,
            "1: Requires unplugging to revert"));


        Currency_UnitList.Clear();
        Currency_UnitList.Add(MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "2 decimal places"));
        Currency_UnitList.Add(MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "3 decimal places"));

        User_Registers_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "User Regisiter");
        Password_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "User Password");
        User_Password_ToolTip = 
            MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, 
            "The password must be greater than 8 characters and less then 10 characters.");
        Modbus_Address_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Modbus Address");
        Modbus_HelpText = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "0:Broadcast ; 1-255: Directional settings");
        POS_Amount_Unit_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "POS Amount Unit");
        POS_Withholding_Amount_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "POS Withholding Amount");
        Electricity_Price_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Electricity Price");
        Service_Charge_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Service Charge");
        Screen_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Text in the lower right corner of the screen");
        RS485_BaudRate_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "RS485 Baud Rate");
        MAC_Reporting_Format_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "MAC reporting format");
        Automatic_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Automatic MAC Charging Countdown in Seconds");
        Whether_Modbus_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Whether to enable MODBUS...");
        Service_Fee_Unit_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Service Fee Unit...");
        Currency_Unit_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Currency Unit Precision...");
        LCD_Media_Open_Config_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "LCD Video Advertising Playback Strategy");
        LCD_Media_Open_Addr_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Video Advertisement Storage Location");
        LCD_Media_Amount_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Number of Video Advertisements Stored on LCD");
        SuspendOrFault_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, 
            "If there is an exception during the charging process startup of the charging pile, should it report as suspend or fault?");
        Offine_Trans_logical_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, 
            "StatusNotification Sending Logic Configuration After Each Network Disconnection and Reconnection");

        Offline_IC_1_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Offline IC Card Number 1");
        Offline_IC_2_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Offline IC Card Number 2");
        Offline_IC_3_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Offline IC Card Number 3");
        Offline_IC_4_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Offline IC Card Number 4");
        Offline_IC_5_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Offline IC Card Number 5");
        Language_Setting_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Language Settings");
        OCPP_Title_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "OCPP Telemetry Server HTTP...?");
        OCPP_UserName_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "User Name");
        OCPP_Password_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "User Password");
        MacCharging_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Mac Charging");
        POS_Charing_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "POS Charing");
        DC_Complatible_Charging_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "DC Complatible Charging Gun");
        AC_Complatible_Charging_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "AC Complatible Charging Gun");
        Disabled_RFID_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Disabled RFID");
        LockToUseUtcTime_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Lock to Use UTC Time");
        PressButtonToStopCharging_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Press Button to Stop Charging");
        ForbidAuthorizeInUnplug_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Prohibition of authentication without inserting a gun");
        Offline_IC_CardLocal_Authorization_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Offline IC Card Local Authorization(ocpp)");
        DisablePE_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Disable PE");
        Calibrating_EVSE_Using_ServerTime_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Calibrating EVSE Using Server Time");
        Retransmit_Notifications_on_Reconnect_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Bootnotification will be resent when reconnecting to the server");
        Scheduled_Heartbeat_Sending_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Scheduled Heartbeat Sending");
        //Enable_the_Second_Platform_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Enable the Second Platform");
        AutomaticChargingforMac_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Automatic Charging for Mac");
        Enable_plug_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Enable plug and play charging in off grid charging mode");
        Delayed_Connection_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Delayed Connection(ocpp)");
        No_Pass_OCPP_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "POS startup, without going through the OCPP platform, enters an unavailable state after startup");
        Ground_Lock_Support_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Ground Lock Support");
        No_Pass_Clash_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage,
            "Allow card swiping authorization without inserting a gun (no button required, The main interface allows direct card swiping authentication)");
        OfflineMaterValue_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Offline MeterValue Disable");
        OCPP_Server_Init = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "OCPP Telemetry Server URL + CPID");
        Stack_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Stake");
        Other_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Other");
        Charging_Start_Failure_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage,
            "Whether to automatically revert to Available or Preparing status after a charging start failure");

        Time_allocation_Text = MainWindowViewModel.SetLanguage(MainWindowViewModel.globellanguage, "Local time of the charging station");
        

        #endregion

        var filr = Directory.GetFiles(savepath);
        Languages.Clear();
        foreach (var ft in filr)
        {
            savepath = ft;
            Languages.Add(new Language
            {
                LanguageName = ft.Split("\\").LastOrDefault()!.Split(".")[1],
                FlagImagePath = savepath,
            });
        }
        //RS485Baud = BaudRateModes.FirstOrDefault() ?? string.Empty;
        //界面切换，参数导入
        #region 垃圾代码
        UserPassword = MainWindowViewModel.pTAConfigModel.用户密码!;
        ModbusAddress = MainWindowViewModel.pTAConfigModel.Modbus!;
        RS485Baud = MainWindowViewModel.pTAConfigModel.RS485波特率! ?? 0;
        MacCharging = MainWindowViewModel.pTAConfigModel.Mac充电是否启动! ?? false;
        PosCharing = MainWindowViewModel.pTAConfigModel.POS是否启动! ?? false;
        DC_Complatible_Charging = MainWindowViewModel.pTAConfigModel.DC枪兼容充电模式是否启用 ?? false;
        AC_Complatible_Charging = MainWindowViewModel.pTAConfigModel.AC枪兼容充电模式是否启用 ?? false;

        PosAmountUnit = MainWindowViewModel.pTAConfigModel.POS金额单位!;
        Currency_Unit_Precision = MainWindowViewModel.pTAConfigModel.货币单位精度!;
        PosWithholdingAmount = MainWindowViewModel.pTAConfigModel.POS预扣款金额!;
        ElecPrice = MainWindowViewModel.pTAConfigModel.单位电价每kwh的价格!;
        ServiceCharge = MainWindowViewModel.pTAConfigModel.单位小时服务费!;
        Enable_the_Second_Platform = MainWindowViewModel.pTAConfigModel.遥测数据设置 ?? false;
        LDCLangurageFirst = MainWindowViewModel.pTAConfigModel.LCD第一语言 ?? 14;
        LDCLangurageSecond = MainWindowViewModel.pTAConfigModel.LCD第二语言 ?? 14;
        AutomaticChargingforMac = MainWindowViewModel.pTAConfigModel.是否启用自动使用MAC充电 ?? false;
        ShowScreen = MainWindowViewModel.pTAConfigModel.屏幕右下角的文字!;
        MacReportFormat = MainWindowViewModel.pTAConfigModel.MAC上报格式 ?? 0;
        Disabled_RFID = MainWindowViewModel.pTAConfigModel.RFID是否禁用 ?? false;
        LockToUseUtcTime = MainWindowViewModel.pTAConfigModel.是否锁定使用UTC时间 ?? false;
        PressButtonToStopCharging = MainWindowViewModel.pTAConfigModel.直接按键停止充电使能 ?? false;
        OCPPCheckData = MainWindowViewModel.pTAConfigModel.OCPP遥测服务器URL_CPID!;

        OCPPUserInit = MainWindowViewModel.pTAConfigModel.OCPP遥测服务器HTTP身份校验使能 ?? false;
        OCPPUserName = MainWindowViewModel.pTAConfigModel.OCPP遥测服务器HTTP身份校验用户名!;
        OCPPUserPassword = MainWindowViewModel.pTAConfigModel.OCPP遥测服务器HTTP身份校验密码!;
        ForbidAuthorizeInUnplug = MainWindowViewModel.pTAConfigModel.是否禁止未插枪远程鉴权 ?? false;
        Offline_IC_CardLocal_Authorization = MainWindowViewModel.pTAConfigModel.离线IC卡允许在OCPP模式下进行本地缓存校验 ?? false;
        DisablePE = MainWindowViewModel.pTAConfigModel.PE检测是否禁用 ?? false;
        EquipTime = MainWindowViewModel.pTAConfigModel.时间!;
        Offline_Card_1 = MainWindowViewModel.pTAConfigModel.离线IC卡号1!;
        Offline_Card_2 = MainWindowViewModel.pTAConfigModel.离线IC卡号2!;
        Offline_Card_3 = MainWindowViewModel.pTAConfigModel.离线IC卡号3!;
        Offline_Card_4 = MainWindowViewModel.pTAConfigModel.离线IC卡号4!;
        Offline_Card_5 = MainWindowViewModel.pTAConfigModel.离线IC卡号5!;
        Calibrating_EVSE_Using_ServerTime = MainWindowViewModel.pTAConfigModel.禁用服务器时间来校准充电桩 ?? false;
        Retransmit_Notifications_on_Reconnect = MainWindowViewModel.pTAConfigModel.Bootnotification在每次重新连接服务器后都会重新发送一次 ?? false;
        Scheduled_Heartbeat_Sending = MainWindowViewModel.pTAConfigModel.Heart总是根据配置项定时发送_不受Websocket的ping_pong影响 ?? false;
        ModbusLimit = MainWindowViewModel.pTAConfigModel.是否启用Modbus临时功率限制 ?? 0;
        Enable_plug = MainWindowViewModel.pTAConfigModel.是否启用离线充电模式下即插即用 ?? false;
        Delayed_Connection = MainWindowViewModel.pTAConfigModel.是否启用OCPP延迟连接 ?? false;
        No_Pass_OCPP = MainWindowViewModel.pTAConfigModel.POS机启动的数据不经过OCPP平台_当POS机启动充电的时候_枪头会变为unavaliable ?? false;
        Ground_Lock_Support = MainWindowViewModel.pTAConfigModel.地锁支持 ?? false;
        Automatic_MAC_Charging_Countdown_in_Seconds = MainWindowViewModel.pTAConfigModel.自动使用MAC充电倒计时秒数!;
        ServiceFeeUnit = MainWindowViewModel.pTAConfigModel.服务费单位 ?? 0;
        SelLCDOpenLogical = MainWindowViewModel.pTAConfigModel.LCD视频广告播放策略 ?? 0;
        SelLCDOpenAddr = MainWindowViewModel.pTAConfigModel.LCD视频广告存放位置 ?? 0;
        SelLCDOpenAccount = MainWindowViewModel.pTAConfigModel.LCD视频广告存放数量 ?? string.Empty;
        SelErrorStartElecMsg = MainWindowViewModel.pTAConfigModel.充电桩启动充电过程异常_是上报suspend还是上报_fault ?? 0;
        No_Pass_Clash = MainWindowViewModel.pTAConfigModel.是否允许充电桩未插枪本地刷卡_无按钮_插枪界面允许直接刷卡鉴权 ?? false;
        OfflineMaterValue = MainWindowViewModel.pTAConfigModel.OfflineMeterValue_禁用 ?? false;
        SelRestartLine = MainWindowViewModel.pTAConfigModel.每次断网重连后_StatusNotification_发送逻辑设定 ?? 0;
        #endregion
        PosAmountUnit = PosAmountUnits.FirstOrDefault() ?? string.Empty;
        Currency_Unit_Precision = Currency_UnitList.FirstOrDefault() ?? string.Empty;
    }
}
